Work Model Service
The work model service offers methods to access the work models of the staff members.
AddWorkModel
This method is used to add a new working time model for an employee.
void AddWorkModel (  
 out TpFault fault,   
 TpAuthentication authentication,   
 WorkModelDto workModel);
| Needed Permission | workdayModels@manage | |
|---|---|---|
| Name | Modifier | Description | 
| fault | Out | Contains the error if an exception occurs. | 
| authentication | User authentication | |
| workModel | The workmodel that shall be added to the users workmodels | 
GetWorkDayModels
Using this method the workday models for the given user can be retrieved starting by start date through the end date.
List<WorkdayDto> GetWorkDayModels(  
 out TpFault fault,   
 TpAuthentication authentication,   
 DateTime startDate,   
 DateTime endDate);
| Needed Permission | workdayModels@access | |
|---|---|---|
| Name | Modifier | Description | 
| fault | Out | Contains the error if an exception occurs. | 
| authentication | User authentication | |
| userSearch | Information that are used to search the TimePunch profiles | |
| startDate | First date for that the workday model shall be retrieved. | |
| endDate | Last date for that the workday model shall be retrieved. | |
| Return value | List of all workday models for the given authentication. | 
GetWorkModel
This method returns the working time model for the passed date.
WorkModelDto GetWorkModel(  
 out TpFault fault,   
 TpAuthentication authentication,   
 DateTime date,   
 Guid? userId = null);
| Needed Permission | workdayModels@access | |
|---|---|---|
| Name | Modifier | Description | 
| fault | Out | Contains the error if an exception occurs. | 
| authentication | User authentication | |
| date | Date used to evaluate the valid work model | |
| userId | User Id for whom the work model shall be received. Or NULL to evaluate it for the current user. | |
| Return value | Work model that is valid for the given date. | 
GetWorkModels
This method returns all working time models for the given employee.
List<WorkModelDto> GetWorkModels(  
 out TpFault fault,   
 TpAuthentication authentication);
| Needed Permission | workdayModels@access | |
|---|---|---|
| Name | Modifier | Description | 
| fault | Out | Contains the error if an exception occurs. | 
| authentication | User authentication | |
| Return value | List of all work models for the authenticated identity | 
SaveWorkModels
This method saves the work schedules for the given employee. It is important that the list is complete, missing working-time models in the staff profile are getting removed.
void SaveWorkModels(  
 out TpFault fault,   
 TpAuthentication authentication,   
 List<WorkModelDto> workModels);
| Needed Permission | workdayModels@manage | |
|---|---|---|
| Name | Modifier | Description | 
| fault | Out | Contains the error if an exception occurs. | 
| authentication | User authentication | |
| workModels | List of all work models for the authenticated identity | 
SetGlobalCoreTimes
This method is used to set the global core working time in TimePunch.
void SetGlobalCoreTime(  
 out TpFault fault,   
 TpAuthentication authentication,   
 List<WorkModelDto> workModels);
| Needed Permission | core@administrate | |
|---|---|---|
| Name | Modifier | Description | 
| fault | Out | Contains the error if an exception occurs. | 
| authentication | User authentication | |
| CoreTimeDto | Contains the begin and the end of the core time |